# -*- coding: utf-8 -*-
# @Time : 2023/11/16 5:08 PM 
# @Author : Wayne
# @Email : 1
# @File : jiami.py
# @Project : python_demo
# @DESCRIPTION :

import hashlib

"""
sha256加密规则，具体代码具体对待
这是kis的一种加密规则：
请求签名串，由 KIS-State + session_id + KIS-TraceID + session_secret + KIS-Timestamp 这些参数的值组合的字符串（不含加号）通过SHA256加密生成的新字符串
https://open.jdy.com/#/files/api/detail?index=2&categrayId=dded94c553614747b2c9b8b49c396aa6&id=c244067336b14d85ae9cf69001d06864
"""
def sha256_jiami():
    time_stamp = "1719497169"

    # 五八
    # str = time_stamp'+"se1718327580uskjnzhiteubmssqtwgs"+time_stamp+"zkduuprqfhewarbswxfrbvizvrbasoxl"+time_stamp # 待加密的字符串
    # 美爵
    str = time_stamp+"se1719497050tjahgodziudbwishoind"+time_stamp+"ynmgsxpsztvtqjpfjeaqtqephuatkjas"+time_stamp  # 待加密的字符串
    # 无锡华纳
    # str = time_stamp+"se1718610757aoclciarkvmbajigybew"+time_stamp+"ywrcmhytadyqhkvwjqmzkrjmottngrvp"+time_stamp  # 待加密的字符串
    sha256 = hashlib.sha256()  # 创建SHA256哈希对象
    sha256.update(str.encode('utf-8'))  # 更新哈希对象
    # print(sha256.hexdigest())  # 输出哈希值
    return sha256.hexdigest()

print(sha256_jiami())